<?php
/**
 * 会员相关
 */
namespace App;
use Control\MemberControl;
use Model\MemberMod;
use Pub\cache\Cache;

defined('IN_IA') or exit('Access Denied');

class MemberA extends A {
    private $Member = null;
    public function __construct()
    {
        parent::__construct();
        $this->Member = new MemberControl();
    }

    /**
     * 获取指定会员信息
     * @param int _uid 用户id
     */
    public function find()
    {
        $_data = $this->Member->find($this->_uid);
        if($_data){
            $this->_result = array("status"=>"success","data"=>$_data);
        }
        $this->result($this->_result);
    }

    /**
     * 设置用户信息
     */
    public function set()
    {
        if($this->Member->set($this->_gpc["data"],array("uid"=>$this->_uid))){
            Cache::remove(Cache::MEMBER_DETAIL,array("uid"=>$this->_uid));
            $this->_result = array("status"=>"success");
        }
        $this->result($this->_result);
    }
}